package Test;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import Tool.*;

public class Content implements Binaryable{
	/** 题号 */
	private int num;
	/** 评卷人ID */
	private int teacherID;
	/** 实际得分 */
	private int score;
	/** 学生答案 */
	private String answer = "";
	
	/** 答案可能用到的图 */
	private Illustration illustration = new Illustration();
	
	/** 教师注释 */
	private String comment = "";
	
	@Override
	public void fromBytes(InputStream in) throws IOException {
		answer = Tool.readString(in);
		comment = Tool.readString(in);
		illustration.fromBytes(in);
	}
	
	@Override
	public void toBytes(OutputStream out) throws IOException {
		Tool.writeString(answer, out);
		Tool.writeString(comment, out);
		illustration.toBytes(out);
	}
	
	/** getters and setters */
	public String getAnswer() {
		return answer;
	}
	
	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
	
	public int getNumber() {
		return num;
	}

	public void setNumber(int number) {
		this.num = number;
	}

	public int getTeacherID() {
		return teacherID;
	}

	public void setTeacherID(int teacherID) {
		this.teacherID = teacherID;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}
}
